<div id="result_go" >
	  <div class="go_view"><div class="back_btn"><span><?php echo l(t('Back'),'go_view/dept'); ?></span></div>
<?php

	//print "<pre>"; print_r($items); print "</pre>"; die;
	//echo "tpl file ok"; 
	 
	foreach ($items as $res){
		
		$dept =  $res->field_go_depart['und']['0']['value'];
		$deptName = get_govt_dept_names($dept); 
		$abstract =  $res->field_go_abstract['und']['0']['value']; 
		$filepath = $res->field_go_available_file['und']['0']['uri'];
		$title = $res->title;
		$go_date = $res->field_go_date['und']['0']['value']; 
		//echo $Year = $go_date->format('d-m-Y');
		$go_date_check = date('d-M-Y',strtotime($go_date));
		$goYear = date("Y", strtotime($go_date));
		
		if(empty($filepath)){		
							$filepath = $res->field_go_available_file['und']['0']['uri'];
							//$department= $contentlist -> dept_name;	
							$icon = '';
					}else{
						  	$icon = get_pdf_icon($filepath)	; 
						 	$filepath = $baseurl.$contentlist->filepath;	
						  	//$department= $contentlist -> dept_name;	
						  
					}
		
		if( $goYear != $go_year )		{ 
					$go_year = $goYear;
					$divOutput1 = "<div class='res_dept go_depart' ><strong>Year : " .  $goYear  . "</strong></div>";
				}
				else		{
					$divOutput1 = '';
				}
		
		if( $deptName != $curdept )		{
			$curdept = $deptName;
			$divOutput =   $deptName ;
						
		}
		else		{
			$divOutput = '';
		}
	?>
	<!--<div class="go_title"><?php //echo $newDate;?><span style="padding:10px;"><?php echo $abstract;?></span> </div>
	<div class="go_abstract"><?php //echo $title; ?></div>-->
	
	<div class="go_box">
				<div class="res_dept go_depart"><span><strong><?php echo $divOutput;?></strong></span></div>
				<div class="go_title"><?php echo $divOutput1 ;?></div>
				
				<div class="go_abstract"><a href='javascript:void(0);' onclick='return tnportal_ext_window("<?php echo $filepath;?>");'>
				<?php print $title . " Dt: ". $go_date_check . $icon;?></a>
				  <?php echo $abstract; ?></div>
	</div>

<?php  } ?>

		</div>
    
	<div class="clr"></div>
	
 </div>
